/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package risk.game.entity.player;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;

import risk.game.entity.Card;
import risk.game.entity.EntityConstants;
import risk.game.entity.map.Continent;
import risk.game.entity.map.Land;
import risk.game.entity.unit.Army;


public class Player implements EntityConstants{
    
    private static int playerId = 0;
	private int id;
    private String name;
    private ImageIcon image;
    //TBD - in case of image the color is not requierd
    private Color color;
    // Actice / In Active
    private int status;
    
    // Player army (currently only one instance - maybe list of army)
    private Army playerArmy;
    // Player card land
    private List<Card> cardlist;
    // player lands
    private List<Land> ownedlandlist;
    //player Continents - in case its owner of all lands
    private List<Continent> ownedContinentList;
	
    public Player(String name,ImageIcon image){
    	this.id = playerId++;
    	this.name = name;
    	this.image = image;
    	this.status = Player.STATUS_ACTIVE;
    }
    
    public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public ImageIcon getImage() {
		return image;
	}
	public void setImage(ImageIcon image) {
		this.image = image;
	}
	public Color getColor() {
		return color;
	}
	public void setColor(Color color) {
		this.color = color;
	}
	public int getStatus() {
		return status;
	}
	public void setActiveStatus() {
		this.status = Player.STATUS_ACTIVE;
	}
	public void setInActiveStatus() {
		this.status = Player.STATUS_INACTIVE;
	}
	public Army getPlayerArmy() {
		return playerArmy;
	}
	public void setPlayerArmy(Army playerArmy) {
		this.playerArmy = playerArmy;
	}
	public List<Card> getCardlist() {
		return cardlist;
	}
	public void setCardlist(List<Card> cardlist) {
		this.cardlist = cardlist;
	}
	public List<Land> getOwnedlandlist() {
		return ownedlandlist;
	}
	public void setOwnedlandlist(List<Land> ownedlandlist) {
		this.ownedlandlist = ownedlandlist;
	}
	public List<Continent> getOwnedContinentList() {
		return ownedContinentList;
	}
	public void setOwnedContinentList(List<Continent> ownedContinentList) {
		this.ownedContinentList = ownedContinentList;
	}
	public void addCard(Card card){
		if(cardlist == null)
			cardlist = new ArrayList<Card>();
		cardlist.add(card);
	}
	public boolean removeCard(Card card){
		if(cardlist != null){
			return (cardlist.remove(card));
		}
		return false;
	}
    

}
